Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support for description completionItem #724

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

Enaium
Copy link
Contributor

@Enaium Enaium commented Dec 30, 2024

No description provided.

@angelozerr
Copy link
Contributor

angelozerr commented Jan 10, 2025

@Enaium could you please do 2 screenshots (with and without your PR) to show the result of completion item please.

@Enaium
Copy link
Contributor Author

Enaium commented Jan 10, 2025

Before:

Now:

@@ -165,7 +165,8 @@ public String getItemText(@NotNull CompletionItem item) {
*/
@Nullable
public String getTypeText(CompletionItem item) {
return item.getDetail();
var labelDetails = item.getLabelDetails();
return labelDetails != null ? labelDetails.getDescription() : null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about labelDetails == null ? item.getDetail() : labelDetails.getDescription(); ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description is worked in vscode

@@ -165,7 +165,8 @@ public String getItemText(@NotNull CompletionItem item) {
*/
@Nullable
public String getTypeText(CompletionItem item) {
return item.getDetail();
var labelDetails = item.getLabelDetails();
return labelDetails != null ? labelDetails.getDescription() : null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Enaium I have tested your PR with other language server like TypeScript, Go etc which doesn't support label detail and the renderer is bad:

image

The detail in this case must be displayed on the right (like vscode does). Please change with

return labelDetails != null ? labelDetails.getDescription() : item.getDetail();

@@ -199,7 +200,7 @@ public boolean isStrikeout(@NotNull CompletionItem item) {
@Nullable
public String getTailText(@NotNull CompletionItem item) {
var labelDetails = item.getLabelDetails();
return labelDetails != null ? labelDetails.getDetail() : null;
return labelDetails != null ? labelDetails.getDetail() : item.getDetail();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the original code like:

return labelDetails != null ? labelDetails.getDetail() : null;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it is not resolved, please keep the original code:

return labelDetails != null ? labelDetails.getDetail() : null;

@angelozerr angelozerr added enhancement New feature or request completion labels Jan 10, 2025
@angelozerr angelozerr added this to the 0.10.0 milestone Jan 10, 2025
@angelozerr
Copy link
Contributor

@Enaium once you will do the fix for #724 (comment) I'm OK to merge your PR.

@angelozerr angelozerr self-requested a review January 10, 2025 14:04
@Enaium Enaium force-pushed the main branch 3 times, most recently from 3b12c2f to 29fa77f Compare January 10, 2025 14:18
@angelozerr angelozerr merged commit 1de8471 into redhat-developer:main Jan 10, 2025
6 checks passed
@angelozerr
Copy link
Contributor

Thanks @Enaium !

@Enaium
Copy link
Contributor Author

Enaium commented Jan 10, 2025

it's working fine now.

@angelozerr
Copy link
Contributor

@Enaium you can install nightly-builds and enjoy with your fix.

@Enaium
Copy link
Contributor Author

Enaium commented Jan 10, 2025

Ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completion enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants